package com.mifengs.mall.ui.hxcec;

import android.content.Context;
import android.text.TextUtils;

import com.hyphenate.helpdesk.model.AgentIdentityInfo;
import com.hyphenate.helpdesk.model.ContentFactory;
import com.hyphenate.helpdesk.model.OrderInfo;
import com.hyphenate.helpdesk.model.QueueIdentityInfo;
import com.hyphenate.helpdesk.model.VisitorInfo;
import com.hyphenate.helpdesk.model.VisitorTrack;
import com.mifengs.mall.R;

/**
 * 对轨迹跟踪的消息操作 此类不是必须，只是为了演示和初始化一些数据
 */
public class DemoMessageHelper {

	public static final String IMAGE_URL_1 = "http://o8ugkv090.bkt.clouddn.com/hd_one.png";
	public static final String IMAGE_URL_2 = "http://o8ugkv090.bkt.clouddn.com/hd_two.png";
	public static final String IMAGE_URL_3 = "http://o8ugkv090.bkt.clouddn.com/hd_three.png";
	public static final String IMAGE_URL_4 = "http://o8ugkv090.bkt.clouddn.com/hd_four.png";


	public static VisitorInfo createVisitorInfo() {
		VisitorInfo info = ContentFactory.createVisitorInfo(null);
		info.nickName(Preferences.getInstance().getNickName())
		    .name(Preferences.getInstance().getUserName())
		    .qq("10000")
			.phone("15811200000")
		    .companyName("easemob")
		    .description("")
		    .email("abc@123.com");
		return info;
	}




	public static VisitorTrack createVisitorTrack(Context context,String title,String price,String desc,String imageUrl,String itemUrl) {
		VisitorTrack track = ContentFactory.createVisitorTrack(null);
		switch(1) {
		case 1:
			track.title(String.format("%s：0001","蜜蜂商城蜂巢欢迎您购物愉快"))
					.price(price)
					.desc(desc)
					.imageUrl(imageUrl)
					.itemUrl(itemUrl);
			break;
		}
		return track;
	}
	
	public static OrderInfo createOrderInfo(Context context,String title,String price,String desc,String imageUrl,String itemUrl) {
		OrderInfo info = ContentFactory.createOrderInfo(null);
		switch(1) {
		case 1:
			info.title(title)
			    .orderTitle("蜜蜂商城蜂巢欢迎您购物愉快")
			    .price(price)
			    .desc(desc)
			    .imageUrl(imageUrl)
			    .itemUrl(itemUrl);
			break;
		}
		return info;
		
	}
	
	public static AgentIdentityInfo createAgentIdentity(String agentName) {
		if (TextUtils.isEmpty(agentName)){
			return null;
		}
		AgentIdentityInfo info = ContentFactory.createAgentIdentityInfo(null);
		info.agentName(agentName);
		return info;
	}
	
	public static QueueIdentityInfo createQueueIdentity(String queueName) {
		if (TextUtils.isEmpty(queueName)){
			return null;
		}
		QueueIdentityInfo info = ContentFactory.createQueueIdentityInfo(null);
		info.queueName(queueName);
		return info;
	}

}
